home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / bmw2.zip / BMW.DOC < prev    next >
Text File  |  1989-02-19  |  12KB  |  268 lines

  1. BMW.EXE - Bar Menu Writer for QuickBASIC 4
  2. Copyright 1989 - Lloyd Doering - All rights reserved
  3.  
  4. BMW.EXE is a utility for QuickBASIC programmers. It's purpose is to read
  5. and input file you've prepared (in ASCII format) and translate that into
  6. the hundreds of lines of source code needed to make a BAR MENU. BMW.EXE
  7. also generates Batch Files that will build standard libraries and quick
  8. libraries for you.
  9.  
  10. 1. Getting started:
  11.  
  12. Copy all of the files from you received with BMW.EXE into a new directory.
  13. Since BMW.EXE will create new files in this directory as we proceed, we
  14. don't want to risk writing over some of your files. That's why you want to
  15. run BMW.EXE in an empty directory until you become familiar with what it
  16. produces. Next, put a copy of QB.LIB, distributed with QuickBASIC in the
  17. current directory. Run the batch file QBLIB.BAT to create QBLIB.QLB and
  18. QBLIB.LIB. QBLIB.BAT extracts a copy of INTRPT.OBJ from QB.LIB so it can
  19. be used to build QBLIB.LIB and QBLIB.QLB. Ignore LIB warning U4156,
  20. "output-library specification ignored". It is a meaningless error in this
  21. particular situation and is no cause for alarm.
  22.  
  23. 2. Create an input file for BMW.EXE
  24.  
  25. Normally, this is something you would do with your word processor. But to
  26. familiarize you with the format of an input file that is digestible by
  27. BMW.EXE we will let BMW make an input file for us.
  28.  
  29. Type BMW C <enter>
  30.  
  31. You will now find the file SAMPLE.WIN in the current directory. At this point
  32. you might want to print a copy of it or at least look at it. As you can see
  33. it is a very short file.
  34.  
  35. Type BMW H <enter>
  36.  
  37. Read the description of an input file for BMW.EXE and compare it with the
  38. file SAMPLE.WIN.
  39. When you are ready...
  40.  
  41. Type BMW SAMPLE <enter>
  42.  
  43. BMW.EXE will now read and digest SAMPLE.WIN and 'RUN'it.  You can experiment
  44. with the menus' frame style by appending a 1, 2, 3, or 4 to this entry,
  45. as follows;
  46.  
  47. Type BMW SAMPLE 1 <enter>  {1 is the default, no real point in specifying it}
  48. Type BMW SAMPLE 2 <enter>
  49. Type BMW SAMPLE 3 <enter>
  50. Type BMW SAMPLE 4 <enter>
  51.  
  52. 3. Generate Source Code for QuicBASIC
  53.  
  54. Type BMW SAMPLE W <enter>
  55.  
  56. BMW will now write source code for QuickBASIC. And it will also generate some
  57. Batch files that will direct LINK.EXE and LIB.EXE and BC.EXE to create the
  58. libraries you will need to use this source code. And, if the program TEST.BAS
  59. is in the current directory, these batch files will also produce TEST.EXE to
  60. test run the created source code at full speed. With the input files
  61. SAMPLE.WIN, BMW will create BARFEVSR.BAS. You can load BARFEVSR.BAS into
  62. QuickBASIC and run it using the command line;
  63.  
  64. QB BARFEVSR /L QBLIB
  65.  
  66. When BMW is finished, you can run these batch files:
  67.  
  68.     a. BARBCOM.BAT - run this batch file to create BARMENU.LIB and to compile
  69.                      TEST.BAS using BCOM45.LIB
  70.     b. BARBRUN.BAT - run this batch file to create BARMENU.LIB and to compile
  71.                      TEST.BAS using BRUN45.LIB
  72.     c. BARQLB.BAT  - run this batch file to create BARMENU.QLB
  73.  
  74.     BARMENU.LIB is what you will use to create EXE files. BARMENU.QLB is
  75.     all the code used to make the Menus in a Quick Library. You use
  76.     BARMENU.QLB with a command line like;
  77.  
  78. QB TEST /L BARMENU
  79.  
  80.     (If you are using an earlier version of QuickBASIC, you will have to
  81.     patch these batch files so that they specify the proper Libraries.)
  82.  
  83. 4. Notes
  84.  
  85. The above step assume you are using your environment variables PATH and LIB.
  86. If you are not, you can save yourself a lot of work by doing so. You will
  87. find information on environment variables in your DOS and QuickBASIC manuals.
  88. The PATH environement variable tells DOS where to find BAT, COM, and EXE
  89. files when they are not in the directory you are working in. The LIB
  90. environment tells programs like LINK.EXE and LIB.EXE where to find LIB files
  91. when they are not in the current directory. If you are not using these two
  92. environment variables then the batch files produced by BMW.EXE will not work
  93. unless you put ALL the files you need in the directory you are working in.
  94. You can set your environment variables from your AUTOEXEC.BAT file. Also,
  95. you may want to investigate the environement variable 'INCLUDE'.
  96.  
  97. If you haven't already, put the statement 'FILES=20' in your CONFIG.SYS file.
  98. BMW opens several files, and if it generates an error that says
  99. 'Too many files' this is the way to fix that problem.
  100.  
  101. Read the program TEST.BAS to examine the behavior of the subroutine
  102. 'BAR' and other subroutines created by BMW.EXE.
  103.  
  104. 5. History and related information
  105.  
  106. This is version 2.0 of BMW.EXE. Error trapping has been expanded over version
  107. 1.0 and line 25 is now used for Dropmenu explanatory remarks. You will have
  108. to patch the Strings that describe the menu selection.
  109.  
  110. The source code to BMW.EXE was started in QuickBASIC, version 4.0 and ported
  111. to version 4.5 without change. The source code to BMW.EXE is available for
  112. $35.00. The source code to BMW.EXE (BMW.BAS) is not public domain or
  113. shareware, and those who purchase it would be expected to use it for their
  114. own private or buisness purposes, and not to distribute it, modified or
  115. unmodified, under any circumstances.
  116.  
  117. Improvements and enhancements to BMW.EXE are underway. Currently I am adding
  118. Microsoft Mouse Compatible code to the output generated by BMW.EXE, and some
  119. additional features. Users of BMW.EXE who would like to receive notice when
  120. this work is complete can register for $5.00. Customized versions of BMW.EXE
  121. can be ordered. Send a printed copy of whatever changes you would like
  122. in the code produced by BMW, register for $5.00, and I'll send you the
  123. price tag. Use a highlighter to document the changed or additional code.
  124. Later versions of BMW.EXE will be available to registered users for $10.00
  125. or $5.00 if you provide the disk, mailer, and postage.
  126.  
  127. Author: Lloyd Doering
  128.         3714 Stephens Rd N.E. #28
  129.         Cleveland, TN
  130.         37312
  131.  
  132. 6. Other information
  133.  
  134. The object files included with BMW.EXE are listed below.
  135.  
  136. APRINT.OBJ  - Attribute Print, writes strings directly to video ram
  137.               The syntax for APRINT is
  138.               APRINT StringToPrint$, Attribute%
  139.               or
  140.               CALL APRINT(StringToPrint$, Attribute%)
  141.               where Attribute specifys the foreground, background
  142.               combination.
  143. CURSOR.OBJ  - Locates the cursor, just like Basic's LOCATE statement. The
  144.               difference is this: If VIEW PRINT has been used to limit the
  145.               cursors travels around the screen, and you call BAR knowing
  146.               that it needs to print on those lines, then you'll have an
  147.               error. What this means is you have to make sure you set
  148.               VIEW PRINT 1 TO whatever before you call BAR. If this get's
  149.               to be an inconvenience, you can replace all the LOCATE
  150.               statements in the code produced by BAR with CURSOR. The syntax
  151.               is CURSOR Row%, Column% - or - CALL CURSOR(Row%, Column%).
  152.               CURSOR ignores any VIEW PRINT statements that may be in
  153.               effect and locates the cursor anyway. CURSOR is a tad slower
  154.               than BASIC's LOCATE, even though it's written in assembly.
  155.               Cursor makes two BIOS calls to do it's job.
  156. BLOCKMOV.OBJ- Moves blocks of memory around for QuickBASIC. Given a source
  157.               and destination Segment/Offset and number of words to move,
  158.               moves the contents of memory from the source to the destination.
  159.               Used to save and restore the screen.
  160.               The syntax for BLOCKMOVE is;
  161.               BLOCKMOVE SSEG%, SOFF%, DSEG%, DOFF%, WordsToMove%
  162.               or
  163.               CALL BLOCKMOVE(SSEG%, SOFF%, DSEG%, DOFF%, WordsToMove%)
  164. SHADOW.OBJ  - Makes the Menu Shadows. Syntax is;
  165.               SHADOW Row%, Column%, Wide%, High%, Attribute%
  166.               or
  167.               CALL SHADOW(Row%, Column%, Wide%, High%, Attribute%)
  168. BITS.OBJ    - Bit information extractor for integers in QuickBASIC.
  169.               Syntax is;
  170.               a% = BITS(Number%, MSB%, LSB%)
  171.               MSB% and LSB% should never exceed 15 or be less than 0.
  172.               LSB should never be greater than MSB.
  173.               Whenever MSB% = LSB%, BITS returns either a 1 or a 0.
  174.               Whenever MSB% > LSB%, BITS returns the value of that range
  175.               of BITS.
  176.               A% = BITS(&HFFFF, 3, 0) would return &HF, or 15 for A%
  177.               A% = BITS(&HFFFF, 0, 0) would return &H1, or 1 for A%
  178.               A% = BITS(&HFFFF, 7, 4) would return &HF, or 15 for A%
  179.               BITS is a FUNCTION. It is not used in any of the code
  180.               produced by BMW.EXE and is included for those who weary
  181.               of figuring out hex mask. Something to tinker with.
  182.  
  183. The code produced by BMW.EXE makes heavy use of COMMON SHARED variables.
  184. If you want to add to the list of COMMON BLOCK variables, do so via the
  185. an INCLUDE file, like BARMENU.BI, as the manual recommends. Since these
  186. are global variables, you should be aware of their names to avoid using
  187. the same names for variables used for another purpose.
  188.  
  189. The Toggle feature that you can assign to a menu selection with the '*'
  190. character establishes the value of an element in a global integer array.
  191. The idea is for your program to behave differently depending on the
  192. value of this variable.
  193.  
  194. As more features were added to the source code, I decided to leave some of
  195. them out of the behavior of BMW.EXE when it is just running an input file,
  196. to keep the size of the executable down. You will find that the best way to
  197. check out your Bar Menu's is to go ahead and let BARBCOM.BAT or BARBRUN.BAT
  198. create TEST.EXE. The behavior of the menus in in this case is what they'll
  199. be when you create an EXE file.
  200.  
  201. 7. Feedback
  202.  
  203. In addition to the Mouse code the next version of BMW.EXE will generate,
  204. a mechanism for generating pop-up menus is being incorporated.
  205.  
  206. Currently, I am considering two methods for getting the information needed
  207. by BMW.EXE when it goes to write a popmenu that is a logical extension of
  208. a Dropmenu.
  209.  
  210. Possibility #1:
  211.  
  212.      File DropMenu1 DropMenu2 DropMenu3 DropMenu4 DropMenu5
  213.      File Selection_1... Selection_2 Selection_3 Selection_4 Selection_5
  214. DropMenu1 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
  215. DropMenu2 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
  216. DropMenu3 Selection_1... Selection_2 Selection_3 Selection_4 Selection_5
  217. DropMenu4 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
  218. DropMenu5 Selection_1 Selection_2 Selection_3 Selection_4 Selection_5
  219. '$POPMENU
  220. PopUpMenu1 DoThis DoThat DoWhatever
  221. PopUpMenu2 DoThis DoThat DoWhatever
  222.  
  223.  
  224. In this input file, I thought that the three periods under File, Selection_1,
  225. would be an indicator to BMW.EXE to read the first line after an imbedded
  226. metacommand such as '$POPMENU, where '$POPMENU is the beginning of
  227. pop up description text. The next time BMW.EXE sees a "..." it knows to
  228. read the next line, which is PopUpMenu2.
  229.  
  230. Possibility #2:
  231. Use the "..." or some other notation to clue BMW to read in a separate file
  232. that describes the popmenu, or a particular line in a separate file that
  233. describes the popmenu[s].
  234.  
  235. Perhaps you have a prefered method. Let me know!
  236.  
  237. This is my checklist for improvements to make to BMW.EXE:
  238.  
  239. 1. Add mouse code
  240. 2. Add PopMenu Code
  241. 3. Add SoftKey Input Screen Code
  242. 4. Add command line argument that tells BMW.EXE to read in other files
  243.    and build them into the libraries. Saves editing time.
  244. 5. Dump built in code for parsing the command line and write the code
  245.    that deciphers the commands
  246. 6. Use environment variables for BMW.EXE to tell it where to look for
  247.    input files and other files, and to tell BMW.EXE what other built
  248.    in handy subroutines and functions to Dump along with the Bar/Drop/Pop
  249.    Menus.
  250. 7. Generate MAK files for MAKE.EXE, faster than BATCH Files
  251. 8. Your ideas!
  252.  
  253. In the end, I want to see hours or even days worth of work shortened to
  254. minutes, and to be able to develope a user friendly program on very short
  255. notice.
  256.  
  257.   
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.